<template>
  <div class="box">
    <h1>Child1:{{num}}</h1>
    <button @click="changeParaent">子组件操作父组件的数据</button>
  </div>
</template>

<script>
export default {
  name: "Child1",
  data() {
    return {
      num: 0
    }
  },

  methods: {
    changeParaent(){
      this.$parent.sum += 10000
    }
  },
};
</script>

<style scoped>
.box {
  background: yellowgreen;
}
</style>
